package com.jimmy.medical.entity;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang.StringUtils;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;

/**
 * 医生
 * 
 * @author jimmy
 * @since 0.1
 */
@Entity
@Table(name = "doctor")
public class Doctor extends AbstractEntity {
	/** 医生姓名*/
	@Column(name = "real_name", length = 100)
	private String realname;
	/** 所属科室*/
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "department_id")
    @NotFound(action = NotFoundAction.IGNORE)
    private HospitalDepartment department;
	
	/** 是否启用*/
	@Column(name = "is_enabled", length = 2)
	private String isEnabled = "Y";
	/** 职称 **/
	@Column(name = "title", length = 32)
	private String title;
	/**诊疗费**/
	@Column(name = "medical_fee")
	private BigDecimal medicalFee;
	
	/** 头像*/
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "photo_id")
    @NotFound(action = NotFoundAction.IGNORE)
	private UploadFile photo;
	
	/** 挂号费*/
	@Column(name = "sign_price")
	private Integer signPrice;
	
	@Column(name = "create_time", length = 20)
	private String createTime;
	@Column(name = "create_user", length = 50)
	private String createUser;
	@Column(name = "update_time")
	private String updateTime;
	@Column(name = "update_user", length = 20)
	private String updateUser;
	public String getRealname() {
		return realname;
	}
	public void setRealname(String realname) {
		this.realname = realname;
	}
	public Integer getSignPrice() {
		return signPrice;
	}
	public void setSignPrice(Integer signPrice) {
		this.signPrice = signPrice;
	}
	public String getIsEnabled() {
		return isEnabled;
	}
	public void setIsEnabled(String isEnabled) {
		this.isEnabled = isEnabled;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public BigDecimal getMedicalFee() {
		return medicalFee;
	}
	public void setMedicalFee(BigDecimal medicalFee) {
		this.medicalFee = medicalFee;
	}
	public UploadFile getPhoto() {
		return photo;
	}
	public void setPhoto(UploadFile photo) {
		this.photo = photo;
	}
	public HospitalDepartment getDepartment() {
		return department;
	}
	public void setDepartment(HospitalDepartment department) {
		this.department = department;
	}
	public String getCreateTime() {
		return createTime;
	}
	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public String getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(String updateTime) {
		this.updateTime = updateTime;
	}
	public String getUpdateUser() {
		return updateUser;
	}
	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}
	public String getDepartmentName() {
		return department.getDepartmentName();
	}
	public String getDepartmentTypeName() {
		return department.getDepartmentTypeName();
	}
}
